﻿<phone:PhoneApplicationPage 
    x:Class="Coding4Fun.MissionControl.WP.Views.LearnCodePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False"
    DataContext="{Binding Path=Instance.CurrentServer,Source={StaticResource CommonViewModel}}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.Background>
                <ImageBrush ImageSource="/Graphics/headlogo.png" Stretch="None"></ImageBrush>
            </Grid.Background>

            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Right">
                <TextBlock HorizontalAlignment="Right" Text="LEARN COMMAND" Style="{StaticResource PhoneTextSubtleStyle}"></TextBlock>
                <TextBlock HorizontalAlignment="Right" Text="{Binding Path=Instance.CurrentSet,Source={StaticResource CommonViewModel}}" Style="{StaticResource PhoneTextSubtleStyle}"></TextBlock>
                <TextBlock HorizontalAlignment="Right" Text="{Binding Name}" Style="{StaticResource PhoneTextSubtleStyle}"></TextBlock>
            </StackPanel>
        </Grid>

        <!--ContentPanel - place additional content here-->
        <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <TextBlock Foreground="Black" Style="{StaticResource PhoneTextLargeStyle}" Text="name:"></TextBlock>
            <TextBox Style="{StaticResource TextBoxWhiteStyle}" x:Name="txtName" KeyDown="txtName_KeyDown"></TextBox>
        </StackPanel>

        <Grid Grid.RowSpan="2" x:Name="grdConnectOverlay" LayoutUpdated="WaitingOverlayLayoutUpdated" Visibility="{Binding Path=Instance.IsWaiting,Source={StaticResource CommonViewModel},Converter={StaticResource BoolToVisibility}}">
            <Grid.Background>
                <SolidColorBrush Opacity=".6" Color="Black"></SolidColorBrush>
            </Grid.Background>

            <StackPanel VerticalAlignment="Center">
                <TextBlock HorizontalAlignment="Center" Margin="24" Text="Attempting to Connect..."></TextBlock>
                <ProgressBar VerticalAlignment="Center" x:Name="perfBar" IsIndeterminate="True"></ProgressBar>
            </StackPanel>
        </Grid>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
            <shell:ApplicationBarIconButton x:Name="btnOK" Click="btnOK_Click" IconUri="/Graphics/appbar.check.png" Text="OK"/>
            <shell:ApplicationBarIconButton x:Name="btnCancel" Click="btnCancel_Click" IconUri="/Graphics/appbar.close.rest.png" Text="Cancel"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
